package psn.zjk.exporter;

import org.apache.poi.xssf.usermodel.XSSFCellStyle;

import java.text.MessageFormat;

/**
 * @author sdyt_zhangjunkai
 * @version 1.0
 * @CLASS_NAME SheetCell
 * @DESCRIPTION
 * @CREATE_TIME 2020/9/2 14:14
 */
public class SheetCell {
    private transient SheetRow sheetRow;
    private transient SheetColumn sheetColumn;
    private Object value;
    /** 所属对象 */
    private Object belongedData;
    private XSSFCellStyle style;


    public SheetCell(SheetRow sheetRow, SheetColumn sheetColumn) {
        this.sheetRow = sheetRow;
        this.sheetColumn = sheetColumn;
    }

    public Object getValue() {
        return value;
    }

    public void setValue(Object value) {
        this.value = value;
    }

    public SheetRow getSheetRow() {
        return sheetRow;
    }

    public void setSheetRow(SheetRow sheetRow) {
        this.sheetRow = sheetRow;
    }

    public SheetColumn getSheetColumn() {
        return sheetColumn;
    }

    public void setSheetColumn(SheetColumn sheetColumn) {
        this.sheetColumn = sheetColumn;
    }

    public XSSFCellStyle getStyle() {
        return style;
    }

    public void setStyle(XSSFCellStyle style) {
        this.style = style;
    }

    public Object getBelongedData() {
        return belongedData;
    }

    public void setBelongedData(Object belongedData) {
        this.belongedData = belongedData;
    }

    @Override
    public String toString() {
        return MessageFormat.format("[{0},{1}]:{2}",sheetRow.getIndex(),sheetColumn.getIndex(),value);
    }

}
